//
// File: welch.cpp
//
// MATLAB Coder version            : 5.4
// C/C++ source code generated on  : 23-Apr-2025 16:26:18
//

// Include Files
#include "welch.h"
#include "rt_nonfinite.h"
#include "coder_array.h"
#include <string.h>

// Function Definitions
//
// Arguments    : coder::array<double, 2U> &in1
//                const coder::array<double, 1U> &in2
// Return Type  : void
//
void binary_expand_op(coder::array<double, 2U> &in1,
                      const coder::array<double, 1U> &in2)
{
  coder::array<double, 2U> b_in1;
  int b_in2_idx_0;
  int b_loop_ub;
  int in2_idx_0;
  int loop_ub;
  int stride_1_0;
  in2_idx_0 = in2.size(0);
  if (in2_idx_0 == 1) {
    b_in2_idx_0 = in1.size(0);
  } else {
    b_in2_idx_0 = in2_idx_0;
  }
  b_in1.set_size(b_in2_idx_0, in1.size(1));
  b_in2_idx_0 = (in1.size(0) != 1);
  stride_1_0 = (in2_idx_0 != 1);
  loop_ub = in1.size(1);
  for (int i{0}; i < loop_ub; i++) {
    if (in2_idx_0 == 1) {
      b_loop_ub = in1.size(0);
    } else {
      b_loop_ub = in2_idx_0;
    }
    for (int i1{0}; i1 < b_loop_ub; i1++) {
      b_in1[i1] = in1[i1 * b_in2_idx_0] + in2[i1 * stride_1_0];
    }
  }
  in1.set_size(b_in1.size(0), b_in1.size(1));
  loop_ub = b_in1.size(1);
  for (int i{0}; i < loop_ub; i++) {
    b_loop_ub = b_in1.size(0);
    for (int i1{0}; i1 < b_loop_ub; i1++) {
      in1[i1] = b_in1[i1];
    }
  }
}

//
// File trailer for welch.cpp
//
// [EOF]
//
